package com.wx.app.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.example.administrator.newemptyapplication.R;
import com.wx.app.mylib.app.BaseActivity;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class Test4 extends BaseActivity {

    @BindView(R.id.btn_send_test4)
    Button btnSend;
    @BindView(R.id.tv_test4)
    TextView tvShow;
    @BindView(R.id.et_test4)
    EditText et4;
    @BindView(R.id.btn_skip_test4)
    Button btnSkip;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test4);
        ButterKnife.bind(mActivity);
        EventBus.getDefault().register(mActivity);
    }

    @OnClick(R.id.btn_send_test4)
    void sendSomeThing() {
        String sendStr = et4.getText().toString();
        EventBus.getDefault().post(sendStr);
    }

    @OnClick(R.id.btn_skip_test4) void skipToT5(){
        Intent intent = new Intent(mActivity,Test5.class);
        startActivity(intent);
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void hello1(String str) {
        tvShow.setText(str);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);
    }
}
